const {con} = require('../db/db');

async function adminLogin(username,password) {
    const sql = `select * from admin where username="${username}";`;

    let [rows] = await con.execute(sql);

    if(rows.length === 0) {
        return 'false1'
    }

    if(rows.length !== 0 && rows[0].password !== password) {
        return 'false2'
    }
    
    if(rows.length !== 0 && rows[0].password === password) {
        return true
    }
}

module.exports={
    adminLogin
}